package restful.servlet;


public class Rule {

	private final Class verb;

	private final String pattern;
	
	private final Responder responder;

	public Rule(Responder responder, Class verb, String pattern) {
		this.responder = responder;
		this.verb = verb;
		this.pattern = pattern;
	}

	public Responder responder() {
		return responder;
	}

	public boolean matches(Class verb, String requestURI) {
		return this.verb.equals(verb) && requestURI.matches(pattern);
	}

}
